const { connect, P } = global

Page(global.connect(
  state => ({
    ...state.globalReducer
  }),
  dispatch => ({
    handleRoute: global.handleRoute,
    handleLicon1Tap(e) {
      console.log('handleLicon1Tap', e)
      wx.navigateBack()
    },
    handleTap(e){
      console.log('handleTap', e)
      const { route, avatar } = e.currentTarget.dataset
      if(route){
        this.handleRoute(e)
      }
      if(avatar){
        this.handleAvatar(e)
      }
    },
    handleAvatar(e){
      console.log('handleAvatar', e)
    }
  })
)(P({
  data: {
  },
  onLoad() {
    console.log(`${this.route} onLoad`)
  },
  handleLogout() {
    wx.removeStorageSync('openid')
    wx.reLaunch({
      url: "/pages/login/login"
    })
  }
})))